#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Mar 10 10:01:32 2019

@author: wuhuan
"""



import cv2 as cv
src=cv.imread('/Users/wuhuan/Desktop/lena.jpg')       
cv.namedWindow('Hello,world!', cv.WINDOW_AUTOSIZE)
cv.imshow('Hello,world!', src)
(B,G,R) = cv.split(src)#提取R、G、B分量
cv.imshow("Red",R)
cv.imshow("Green",G)
cv.imshow("Blue",B)
hsv = cv.cvtColor(src,cv.COLOR_BGR2HSV)
cv.imshow("HSV",hsv)
hsvChannels=cv.split(hsv)
cv.imshow("Hue",hsvChannels[0])
cv.imshow("Saturation",hsvChannels[1])
cv.imshow("Value",hsvChannels[2])
cv.waitKey(0)
cv.destroyAllWindows()
cv.waitKey(1)
cv.waitKey(1)
cv.waitKey(1)
cv.waitKey(1)

